From: Florian Müllner Date: Tue, 12 Nov 2024 23:42:56 +0000 (+0100) Subject: status/backlight: Fix keynav within discrete item X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~185^2^2~8 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c1487901f48ed90cf65795c12877b4a73fb82a13;p=gnome-shell.git status/backlight: Fix keynav within discrete item When representing the keyboard backlight levels as discrete items, it is currently not possible to keynav past the first button. Fix this by bypassing the usual event bubbling and passing key press events directly to the focus manager, similar to what we do for popup menu items. Part-of: (cherry picked from commit 64c9baf412fa3709ab519d16caaec698db886ed0) --- diff --git a/js/ui/status/backlight.js b/js/ui/status/backlight.js index 105aabc47..b39cfa632 100644 --- a/js/ui/status/backlight.js +++ b/js/ui/status/backlight.js @@ -133,6 +133,10 @@ const DiscreteItem = GObject.registerClass({ this._levelButtons.set(key, box); } + vfunc_key_press_event(event) { + return global.focus_manager.navigate_from_event(event); + } + _syncLevels() { this._levelButtons.get('off').visible = this.nLevels > 0; this._levelButtons.get('high').visible = this.nLevels > 1;